-module(simpleone_sup).
-behaviour(supervisor).
-export([start_link/0, start_child/1]).
-export([init/1]).
-define(SERVER, ?MODULE). % macro that just defines this module as supervisor

start_link() ->
    supervisor:start_link({local, ?SERVER},?MODULE, []).

start_child(Name) ->
    supervisor:start_child(?SERVER, [Name]).

init([]) ->
    Restart = {simple_one_for_one, 0, 1},
    ChildSpec1 = {child1,
                  {simpleone_serv, start_link, []},
                  temporary,
                  brutal_kill,
                  worker,
                  [simpleone_serv]},
    Children = [ChildSpec1],
    SupervisorSpec = {Restart, Children},
    {ok, SupervisorSpec}.
